<?php
function _display_error_message_0($element){
	$messages = $element->getMessages();
	if (!empty($messages)){
		?><div style="border:1px solid red;background-color:#c99"><?php
		foreach ($messages as &$message)
			echo $message;
		?></div><?php
	}
}
?>

<form action="<?php echo $this->action; ?>" method="post">
<fieldset><legend>Information de connection</legend><div>
<?php _display_error_message_0($this->elements['mail']);?>
<p><label for="mail">Adresse e-mail</label>
<input name="mail" type="text" maxlength="50" id="mail" value="<?php echo $this->elements['mail']->getValue();?>" /></p>
</div><div>
<?php _display_error_message_0($this->elements['password']);?>
<p><label for="password">Mot de passe</label>
<input name="password" type="password" id="password" value="<?php echo $this->elements['password']->getValue();?>" /></p>
</div><div>
<?php _display_error_message_0($this->elements['confirm']);?>
<p><label for="confirm">Répétez le mot de passe</label>
<input name="confirm" type="password" id="confirm" value="<?php echo $this->elements['confirm']->getValue();?>" /></p>
</div></fieldset><fieldset><legend>Information public</legend><div>
<?php _display_error_message_0($this->elements['pseudo']);?>
<p><label for="pseudo">pseudo</label>
<input name="pseudo" type="text" maxlength="20" id="pseudo" value="<?php echo $this->elements['pseudo']->getValue();?>" /></p>
</div><div>
<?php _display_error_message_0($this->elements['race']);?>
<p><span>Clan</span><?php
$element = $this->elements['race'];
$error = !$element->emptyMessage();
$value = $element->getValue();
?>
<input name="race" value="ashen" id="ashen" type="radio"<?php if (!$error && 'ashen' === $value) echo ' checked="checked"';?> />
<label for="ashen">Ashen</label><input name="race" value="eldarks" id="eldarks" type="radio"<?php if (!$error && 'eldarks' === $value) echo ' checked="checked"';?> />
<label for="eldarks">Eldarks</label><input name="race" value="yukron" id="yukron" type="radio"<?php if (!$error && 'yukron' === $value) echo ' checked="checked"';?> />
<label for="yukron">Yukron</label><input name="race" value="werlingz" id="werlingz" type="radio"<?php if (!$error && 'werlingz' === $value) echo ' checked="checked"';?> />
<label for="werlingz">Werlingz</label></p>
</div></fieldset><fieldset><legend>Réglement</legend><div>
<?php _display_error_message_0($this->elements['settlement']);?>
<p><input name="settlement" type="checkbox" id="settlement"<?php if ($this->elements['settlement']->emptyMessage() && null !== $this->elements['settlement']->getValue()):?> checked="checked"<?php endif;?> /><label for="settlement">J'ai lu et j'accepte <a href="#" title="Règlement de sun-wars">les règles</a>.</label></p></div></fieldset><p><input name="register" type="submit" /></p>
</form>